package cn.org.xiaosheng.core.registery;

import cn.org.xiaosheng.core.utils.NacosUtils;
import com.alibaba.nacos.api.exception.NacosException;

import java.net.InetSocketAddress;

/**
 * @author XiaoSheng
 * @date 2024/8/22 上午10:34
 */
public class NacosServerRegistry implements ServerRegistry{


    @Override
    public void register(String serviceName, InetSocketAddress inetSocketAddress) {
        try {
            NacosUtils.registerServer(serviceName,inetSocketAddress);
        } catch (NacosException e) {
            throw new RuntimeException("注册Nacos出现异常");
        }
    }

    @Override
    public InetSocketAddress getService(String serviceName) {
        return null;
    }
}
